<template>
	<view class="content">
		<view class="h3">
			请输入您的账单金额
		</view>
		<view class="input">
			¥ <input type="number" v-model="params.repayment_money" :focus="true" value="" />
		</view>
		<view class="btn" @click="goLink()">
			下一步
		</view>
	</view>
</template>

<script>
	import {makeAuto} from '@/common/creditcardmachine.api.js'
	export default {
		data() {
			return {
				params: {
					bankcard_id: '',
					repayment_money:'',
				}
			}
		},
		onLoad(options) {
			this.params.bankcard_id = options.bankcard_id
		},
		methods: {
			openPage(path, params = {}) {
				this.$u.route({
					url: path,
					params
				})
			},
			goLink() {
				uni.showLoading({
					title: '正在生成计划...',
				})
				makeAuto(this.params).then(res => {
					uni.hideLoading()		
					let params1={deCode:res}
					params1.deCode = JSON.stringify(res)
					this.openPage('/pages/creditcard/autoPayMoney/update',params1)
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.content {
		padding: 30rpx;

		.h3 {
			font-size: 40rpx;
			font-weight: bold;
		}

		.input {
			width: 100%;
			display: flex;
			margin-top: 30rpx;
			color: red;
			align-items: baseline;
			font-size: 30rpx;
			border-bottom: 1px solid #d7331e;

			input {
				flex: 1;
				height: 87rpx;
				font-size: 50rpx;
				margin-left: 15rpx;
			}
		}

		.btn {
			width: 100%;
			height: 94rpx;
			color: #fff;
			font-size: 36rpx;
			text-align: center;
			line-height: 94rpx;
			border-radius: 10rpx;
			background-color: #ec6a38;
			margin-top: 50rpx;
		}
	}
</style>
